﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterBackEnd.Master" AutoEventWireup="true" CodeFile="Help.aspx.cs" Inherits="Pages_Help" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <script src="/Js/Pages/Help.js" type="text/javascript"></script>
    <script src="/plugin/editor/tiny_mce/tiny_mce.js" type="text/javascript"></script>
    <script src="/plugin/editor/tiny_mce/plugins/imagemanager/js/imageManager.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            Pages_Help.documentReady(<%=Newtonsoft.Json.JsonConvert.SerializeObject(lstGame) %>);
        });
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
            tinyMCE.init({
                // General options
                mode: "exact",
                elements: "txtContent",
                entity_encoding: "raw",
                theme: "advanced",
                plugins: "pagebreak,table,advhr,advimage,advlink,inlinepopups,preview,searchreplace,contextmenu,paste,fullscreen,noneditable,visualchars",
                language: "vi",

                // Theme options
                theme_advanced_buttons1: "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,fontselect,fontsizeselect",
                theme_advanced_buttons2: "cut,copy,paste,pastetext,|,search,replace,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,image,cleanup,|,preview,|,forecolor,backcolor",
                theme_advanced_buttons3: "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,advhr,|,fullscreen",
                theme_advanced_buttons4: "",
                theme_advanced_toolbar_location: "top",
                theme_advanced_toolbar_align: "left",
                theme_advanced_statusbar_location: "",
                theme_advanced_resizing: false
            });

        });

        function openImageManager() {
            ImageManager.openImageManager(1);
        };

        $(function () {
            $("#aContextMenu").live('click', function () {
                $('.context-menu').hide();
                $(this).next().toggle();
            });

            $(document).click(function (event) {
                if ($('.context-menu').is(':visible') && !$(event.target).closest(".context-menu").size() && !$(event.target).closest("#aContextMenu").size()) {
                    $('.context-menu').hide();
                }
            });

            $("#aEditHelp").click(function () {
                $("#divSearch").hide();
                $("#divList").hide();
                $("#divHelpDetail").show();
            });
            $("#btnCancelHelp").click(function () {
                $("#divHelpDetail").hide();
                $("#divList").show();
                $("#divSearch").show();
            });

            $("#btnAddHelp").click(function () {
                $("#divSearch").hide();
                $("#divList").hide();
                $("#divHelpDetail").show();
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <div style="margin-top: 30px;" class="tabs_wrapper">
        <ul class="tabs">
            <li class="selected tab_link"><span class="tab_link">Quản lý điều khoản</span> </li>
        </ul>
    </div>
    <div class="container_data" id="divSearch">
        <div class="header_container">
            <span class="container_text">Tìm kiếm</span>
            <div class="clear">
            </div>
        </div>
        <div class="content padding0">
            <div class="form form_3cols">
                <div class="content_info">
                    <ul>
                        <li class="content_info_left">Loại nội dung:</li>
                        <li class="content_info_right" style="width: 200px">
                            <select id="ddlType">
                                <option value="-1">[--Tất cả--]</option>
                               <option value="1">Điều khoản</option>
                               <option value="2">Trợ giúp</option>
                            </select></li>
                            <li class="content_info_left">Game:</li>
                        <li class="content_info_right" style="width: 200px">
                            <select id="ddlGame">
                               <%foreach (var item in lstGame)
                                  { %>
                                <option value="<%=item.Id %>"><%=item.Name %></option>
                                <%} %>
                            </select></li>                            
                             <li class="content_info_left">Tiêu đề:</li>
                        <li class="content_info_right" style="width: 200px">
                            <input type="text" id="txtTitle"/>
                        </li>
                        <div style="clear: both;">
                        </div>
                    </ul>
                </div>
                <div style="clear: both;">
                </div>
            </div>
            <div class="form_btn" align="left">
                <input id="btnSearch" class="button" value="Tìm kiếm" type="button" />
            </div>
            <div style="clear: both;">
            </div>
        </div>
        <div class="clear">
        </div>
    </div>
    <div class="container_data" id="divList">
        <div class="header_container">
            <span class="container_text">Danh sách điều khoản<span class="text_blue" style="font-size: 10px; padding-left: 3px; font-weight: normal"
                id="spTotalHelp"></span></span>
            <div class="adminBox_Control">                               
                <% if ((m_Permission & (int)Config.EnumPermission.New) == (int)Config.EnumPermission.New)
                   {%>
                <div class="action" id="btnAddHelp" style="background: url(/images/icon_add.gif) no-repeat scroll 3px 3px #C1E4FF;">
                    Thêm mới
                </div>
                <%} %>
            </div>
            <div class="clear">
            </div>
        </div>
        <div class="content padding0">
            <div class="detailprice " style="padding: 2px;">
                <div id="divListHelp">
                </div>
                <div id="divHelpPaging"></div>
                <div style="clear: both;">
                </div>
            </div>
        </div>
        <div style="clear: both">
        </div>
    </div>
    <div id="divHelpDetail" class="container_data" style="display: none">
        <div class="header_container">
            <span class="container_text">Chi tiết điều khoản</span>
            <div class="adminBox_Control">
                <div class="action" id="btnUpdateHelp" style="background: url(/images/icon_save.gif) no-repeat scroll 3px 3px #C1E4FF;">
                    Cập nhật
                </div>
                <div class="action" id="btnCancelHelp" style="background: url(/images/icon_close.gif) no-repeat scroll 3px 3px #C1E4FF;">
                    Bỏ qua
                </div>
            </div>
            <div class="clear">
            </div>
        </div>
        <div class="content padding0">
            <div class="form form_3cols">
                <div class="content_info">
                    <ul>
                        <li class="content_info_left" style="width: 150px">Loại nội dung:</li>
                        <li class="content_info_right">
                            <select id="ddlTypeUpdate">
                                <option value="1">Điều khoản</option>
                               <option value="2">Trợ giúp</option>                                
                            </select></li>
                        <div style="clear: both">
                        </div>
                    </ul>
                </div>
                 <div class="content_info">
                    <ul>
                        <li class="content_info_left" style="width: 150px">Game:</li>
                        <li class="content_info_right">
                            <select id="ddlGameUpdate">
                                <%foreach (var item in lstGame)
                                  { %>
                                <option value="<%=item.Id %>"><%=item.Name %></option>
                                <%} %>
                            </select></li>
                        <div style="clear: both">
                        </div>
                    </ul>
                </div>
                <div class="content_info">
                    <ul>
                        <li class="content_info_left" style="width: 150px">Trạng thái:</li>
                        <li class="content_info_right">
                            <select id="ddlStatusUpdate">
                                <option value="1">Kích hoạt</option>
                                <option value="0">Khóa</option>
                            </select></li>
                        <div style="clear: both">
                        </div>
                    </ul>
                </div>
                <div class="content_info" id="divCreateDate">
                    <ul>
                        <li class="content_info_left" style="width: 150px">Ngày chỉnh sửa cuối:</li>
                        <li class="content_info_right">
                            <label id="lbCreateDate" class="formcart2" style="margin-left: 0px;">
                            </label>
                        </li>
                        <div style="clear: both;">
                        </div>
                    </ul>
                </div>
                <div style="clear: both">
                </div>
                <div class="content_info">
                    <ul>
                        <li class="content_info_left" style="width: 150px">Tiêu đề:</li>
                        <li class="content_info_right">
                            <input type="text" id="txtTitleUpdate" style="width: 350px;" />
                        </li>
                        <div style="clear: both;">
                        </div>
                    </ul>
                </div>
                <div style="clear: both">
                </div>
                <div class="content_info">
                    <ul>
                        <li class="content_info_left" style="width: 150px">Mô tả:</li>
                        <li class="content_info_right">
                            <textarea id="txtDescription" style="width: 350px; height: 100px;" ></textarea>
                        </li>
                        <div style="clear: both;">
                        </div>
                    </ul>
                </div>
                <div style="clear: both">
                </div>
                <div class="content_info">
                    <ul>
                        <li class="content_info_left" style="width: 150px">Nội dung:</li>
                        <li class="content_info_right">
                            <textarea id="txtContent" style="width: 600px; height: 500px;" ></textarea>
                        </li>
                        <div style="clear: both;">
                        </div>
                    </ul>
                </div>
                <div style="clear: both">
                </div>
            </div>
        </div>
        <div style="clear: both">
        </div>
    </div>
</asp:Content>

